<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateDriverRecordLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('driver_record_log', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('driver_id')->index()->comment('司机ID');
            $table->string('name', 50)->comment('名称');
            $table->decimal('money',10,2)->default(0)->comment('金额');
            $table->timestamp('stard_time')->nullable()->comment('提现或接单时间');
            $table->timestamp('end_time')->nullable()->comment('到账时间或结算时间');
            $table->char('order_sn', 19)->comment('订单编号');
            $table->enum('status', [0,1, 2 ,3])->default(0)->comment('提现状态：0-发起提现，1-后台审核中,2 提现成功 3 审核拒绝');
            $table->string('note', 200)->comment('备注');
            $table->enum('type', [1, 2, 3])->default(1)->comment('提现类型：1-微信，2-支付宝，3-银行卡');
            $table->enum('set_type', [1, 2])->default(1)->comment('类型：1-余额提现，2-订单结算');
            $table->enum('in_type', [0, 1])->default(0)->comment('类型：0-减，1-加');
            $table->timestamps();
        });
        \DB::statement("ALTER TABLE `driver_record_log` comment '司机账户明细表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('driver_record_log');
    }
}
